﻿using FluentValidation;
using SH.Multitenant.Domain.RBAC;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SH.Multitenant.Application.IServices.IEmp
{
    public class EmployeeAddDTO
    {
        /// <summary>
        /// 员工编号 入职时间戳
        /// </summary>
        //[SugarColumn(IsPrimaryKey = true)]
        public string EmpId { get; set; }
        /// <summary>
        /// 员工账号
        /// </summary>
        //[SugarColumn(ColumnDataType = "Nvarchar(20)")]
        public string? EmpName { get; set; }
        /// <summary>
        /// 员工密码
        /// </summary>
        //[SugarColumn(ColumnDataType = "Nvarchar(20)")]
        public string? EmpPwd { get; set; }
        /// <summary>
        /// 手机号码
        /// </summary>
        //[SugarColumn(ColumnDataType = "Nvarchar(11)")]
        public string? Tel { get; set; }
        /// <summary>
        /// 邮箱
        /// </summary>
        //[SugarColumn(ColumnDataType = "Nvarchar(200)")]
        public string? Email { get; set; }
        /// <summary>
        /// 性别
        /// </summary>
        public bool Gender { get; set; }
        /// <summary>
        /// 入职时间
        /// </summary>
        public DateTime? EntryTime { get; set; }
        /// <summary>
        /// 员工状态
        /// </summary>
        public int EmpStatus { get; set; } = 1;
        /// <summary>
        /// 门店编号
        /// </summary>
        public int StoreId { get; set; }
        /// <summary>
        /// 员工姓名
        /// </summary>
        //[SugarColumn(ColumnDataType = "Nvarchar(50)")]
        public string? RealName { get; set; }

        /// <summary>
        /// 角色id
        /// </summary>
        public int RoleId { get; set; }
    }
    public class EmployeeAddDTOValidator : AbstractValidator<EmployeeAddDTO>
    {
        public EmployeeAddDTOValidator()
        {
            
            RuleFor(x => x.EmpName).NotEmpty().MaximumLength(20);
            RuleFor(x => x.EmpPwd).NotEmpty().MaximumLength(20);
            RuleFor(x => x.Tel).NotEmpty().MaximumLength(11);
            RuleFor(x => x.RealName).NotEmpty().MaximumLength(50);
            RuleFor(x => x.Email).MaximumLength(200);
            RuleFor(x => x.EntryTime).NotEmpty();
        }
    }
}
